/**
 * 项目示例-列表表头
 * Date 2023-5-25 09:33:56
 * 可选参数可参考：https://element-plus.org/zh-CN/component/table.html#table-column-属性
 */
interface ExampleListItem {
  houseName: string;
  houseType: string;
  houseCode: string;
  num: string;
  area: string;
  price: string;
  rent: string;
  region: string;
  organNames: string;
  condition: string;
  nature: string;
  ability: string;
  maintainLimit: string;
  dutyOrganName: string;
  linkUserName: string;
  linkPhone: string;
  floor: string;
  coordinate: string;
  lastUpdateTime: string;
}

export const mapListColumns = [
  { type: 'selection',  width: 60, align: 'center' },
  {
    prop: 'unitNumber', label: '单位编号', width: 350, align: 'center', ellipsis: true
  },
  {
    prop: 'unitName', label: '单位名称', width: 350, align: 'center', ellipsis: true
  },
  {
    prop: 'rummagerTime', label: '检查时间', width: 350, align: 'center', ellipsis: true
  },
  {
    prop: 'updateTime',
    label: '删除时间',
    sortable: true,
    width: 350,
    align: 'center',
    ellipsis: true,
    formatter: function (row: any, column: any, cellValue: any) {
      if (cellValue) {
        const date = new Date(cellValue);
        const year = date.getFullYear().toString();
        const month = (date.getMonth() + 1).toString().padStart(2, '0');
        const day = date.getDate().toString().padStart(2, '0');
        const hours = date.getHours().toString().padStart(2, '0');
        const minutes = date.getMinutes().toString().padStart(2, '0');
        const seconds = date.getSeconds().toString().padStart(2, '0');
        return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
      } else {
        return '-'
      }
    }
  },
  {
    prop: 'action', label: '操作', fixed: 'right',  align: 'center'
  }
]
